package com.atguigu.gulimall.config;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class GulimallElasticSearchConfig {

    @Bean
    public RestHighLevelClient esRestClient(){
        HttpHost[] hosts = new HttpHost[1];
        hosts[0]=new HttpHost("175.24.226.131", 9200,"http");
        return new RestHighLevelClient(RestClient.builder(hosts));
    }
    
}
